<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>标书审核管理</title>
	<meta name="decorator" content="default"/>
	<link rel="stylesheet" href="${ctxStatic}/common/bootstrap.min.css">
	<link rel="stylesheet" href="${ctxStatic}/common/AdminLTE.min.css">
	<link rel="stylesheet" href="${ctxStatic}/common/jeesite.css">
	<script src="${ctxStatic}/jquery-validation/1.16/jquery.validate.js"></script>
	<script src="${ctxStatic}/jquery-validation/1.16/jquery.validate.extend.js"></script>
	<script src="${ctxStatic}/jquery-validation/1.16/localization/messages_zh_CN.js"></script>
	<style type="text/css">
		
	</style>
	<script type="text/javascript">
		$(document).ready(function() {
			//$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
			$("#btnRes").click(function(){
				top.$.jBox.confirm("确认要提交终稿标书吗？","系统提示",function(v,h,f){
					if(v == "ok"){
						$("#tenderFlag").val("1");
						$("#inputForm").submit();
					}
				},{buttonsFocus:1});
				top.$('.jbox-body .jbox-icon').css('top','55px');
			});
			$("[data-toggle='popover']").popover();
		});
		
		function proInfoFn(){
			
		}
		
		function auditFn(id){
			$.jBox($("#auditBox").html(), {title:"标书审核", height:200, width:470, buttons:{"提交":"ok", "关闭":true}, 
				loaded:function(h){
					$(".jbox-title-panel").css("height", "40px");
					$(".jbox-button-panel").css("height", "35px");
				},submit:function(v, h, f){
					if (v == "ok"){
						$("#hideAuditState").val(h.find("input[name='radioAuditState']:checked").val());
						$("#hideAuditContent").val(h.find("#auditContent").val());
						$("#hideId").val(id);
						$("#auditForm").submit();
					} 
				}
			});
		}
		
	</script>
</head>
<body>
	<div id="auditBox" class="hide">
		<form id="auditForm" action="${ctx}/zx/makeTender/tenderAudit" method="post" onsubmit="loading('正在提交，请稍等...');">
			<input value="${makeTender.lzdId}" name="lzdId" type="hidden">
			<input name="fileId" type="hidden" id="hideId">
			<input name="sectionId" type="hidden" value="${makeTender.sectionId}">
			<input name="auditState" type="hidden" id="hideAuditState">
			<input name="auditContent" type="hidden" id="hideAuditContent">
			<div class="main-content">
	  			<div class="box box-main">
	  				<div class="box-body">
						<div class="col-xs-10">
							<div class="form-group">
								<label class="control-label col-sm-4" title="">
									<span class="required hide">*</span> &nbsp;&nbsp;<i class="fa icon-question hide"></i>
								</label>
								<div class="col-sm-8">
									<span>通过</span><input type="radio" style="margin:0 0 0 0" name="radioAuditState" value="1" checked="checked">&nbsp;&nbsp;&nbsp;&nbsp;
									<span>不通过</span><input type="radio" style="margin:0 0 0 0" name="radioAuditState" value="2">
								</div>
							</div>
						</div>
						<div class="col-xs-10">
							<div class="form-group">
								<label class="control-label col-sm-4" title="">
									<span class="required hide">*</span> 审核意见：<i class="fa icon-question hide"></i>
								</label>
								<div class="col-sm-8">
									<textarea rows="2" maxlength="500" class="form-control" cssStyle="border-radius: 4px;" id="auditContent"></textarea>
								</div>
							</div>
						</div>
					</div>
	  			</div>
	  		</div>
			
		</form>
	</div>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/zx/makeTender/audit">标书列表</a></li>
		<li class="active"><a href="${ctx}/zx/makeTender/auditForm?lzdId=${makeTender.lzdId}&sectionId=${makeTender.sectionId}">标书审核</a></li>
	</ul>
	<div class="main-content">
	  <div class="box box-main">
	  	
	  	<form:form id="inputForm" modelAttribute="makeTender" action="${ctx}/zx/makeTender/save" method="post" class="form-horizontal">
			<form:hidden path="id"/>
			<form:hidden path="lzdId"/>
			<form:hidden path="sectionId"/>
			<form:hidden path="tenderFlag"/>
			<sys:message content="${message}"/>	
			<div class="box-body">
				<!-- 项目详情 -->
				<div id="proInfo1">
					<div class="form-unit">基本信息 
						<span style="float: right">
							<a href="${ctx}/zx/all/lzd/getLzdAllInfo?lzdId=${makeTender.lzdId}&sectionId=${makeTender.sectionId}&pageFlag=makeTender"> 查看更多项目详情>></a>
						</span>
					</div>
					<div class="row">
						<div class="col-xs-6">
							<div class="form-group">
								<label class="control-label col-sm-4" title="">
									<span class="required hide">*</span> 项目名称：<i class="fa icon-question hide"></i></label>
								<div class="col-sm-8">
									<form:input path="lzd.proName" maxlength="100" class="form-control required" cssStyle="height:30px" disabled="true"/>
								</div>
							</div>
						</div>
						<div class="col-xs-6">
							<div class="form-group">
								<label class="control-label col-sm-4" title="">
									<span class="required hide">*</span> 项目负责人：<i class="fa icon-question hide"></i></label>
								<div class="col-sm-8">
									<form:input path="lzd.proPic" maxlength="100" class="form-control" cssStyle="height:30px" disabled="true"/>
								</div>
							</div>
						</div>
					</div>
					<div class="row">
						<div class="col-xs-6">
							<div class="form-group">
								<label class="control-label col-sm-4" title="">
									<span class="required hide">*</span> 标书完成时间：<i class="fa icon-question hide"></i>
								</label>
								<div class="col-sm-8">
									<input type="text" disabled="true" maxlength="20"  style="width:100%;height:30px" class="form-control"
										value="<fmt:formatDate value="${makeTender.lzd.endTime}" pattern="yyyy-MM-dd HH:mm:ss"/>" />
					
								</div>
							</div>
						</div>
						<div class="col-xs-6">
							<div class="form-group">
								<label class="control-label col-sm-4" title="">
									<span class="required hide">*</span> 采购单位：<i class="fa icon-question hide"></i></label>
								<div class="col-sm-8">
									<form:input path="lzd.buyUnit" maxlength="255" class="form-control" cssStyle="height:30px" disabled="true"/>
								</div>
							</div>
						</div>
					</div>
					<div class="row">
						<div class="col-xs-6">
							<div class="form-group">
								<label class="control-label col-sm-4" title="">
									<span class="required hide">*</span> 项目参数文件：<i class="fa   icon-question hide"></i>
								</label>
								<div class="col-sm-8">
									<form:hidden id="proParamFile" path="lzd.proParamFile" htmlEscape="false" maxlength="100" class="input-xlarge"/>
									<sys:ckfinder input="proParamFile" type="files" readonly="true" uploadPath="/zx/proParamFile" selectMultiple="true"/>
								</div>
							</div>
						</div>
					</div>
				</div>
				
				<!-- ---------------分割符-------------------->
				<div class="form-unit">标书制作信息</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> 项目编码：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<form:input path="proNo" readonly="true" maxlength="100" class="form-control" cssStyle="height:30px"/>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> 标书制作人：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<form:input path="makeTenderBy" readonly="true" maxlength="100" class="form-control" cssStyle="height:30px"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> 审核人：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<form:input path="auditor" readonly="true" maxlength="100" class="form-control required" cssStyle="height:30px"/>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> 保证金金额：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<form:input path="depositMoney" readonly="true" maxlength="100" class="form-control" cssStyle="height:30px"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required hide">*</span> 备注信息：<i class="fa icon-question hide"></i>
							</label>
							<div class="col-sm-10">
								<form:textarea path="remarks" readonly="true" rows="3" maxlength="500" class="form-control" cssStyle="border-radius: 4px;"/>
							</div>
						</div>
					</div>
				</div>
				<div class="form-unit">标书文件</div>
				<c:if test="${fn:length(makeTender.fileList) == 0}">
					<div style="margin-left: 60px">暂未上传标书</div>
				</c:if>
				<c:forEach items="${makeTender.fileList}" var="e" varStatus="st">
					<div class="control-group" style="padding-bottom:0px"></div>
					<div class="row">
						<div class="col-xs-12">
							<div class="form-group">							
								<div class="col-sm-8" style="margin-left: 60px">
									<form:hidden path="fileList[${st.index}].id" />
									<form:hidden id="tenderFile${st.index}" path="fileList[${st.index}].fileUrl" htmlEscape="false" maxlength="100" class="input-xlarge"/>
									<sys:ckfinder input="tenderFile${st.index}" type="files" uploadPath="/zx/tenderFile" selectMultiple="false" readonly="true"/>
									<span class="label label-success" style="margin-left: 5px;font-size: 90%;font-weight: 400;">上传时间：<fmt:formatDate value="${e.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/></span>
									<c:if test="${e.auditState eq '0'}">
										<%-- <input class="btn btn-danger btn-sm" type="button" value="审核" onclick="auditFn('${e.id}')"/> --%>
										<span class="label label-primary" style="margin-left: 5px;font-size: 90%;font-weight: 400;cursor:pointer" onclick="auditFn('${e.id}')">去审核</span>
									</c:if>
									<c:if test="${e.auditState eq '1'}">
										<span class="label label-success" style="margin-left: 5px;font-size: 90%;font-weight: 400;">审核时间：<fmt:formatDate value="${e.auditDate}" pattern="yyyy-MM-dd HH:mm:ss"/></span>
										<span class="label label-success" style="margin-left: 5px;font-size: 90%;font-weight: 400;">审核通过</span>
									</c:if>
									<c:if test="${e.auditState eq '2'}">
										<span class="label label-success" style="margin-left: 5px;font-size: 90%;font-weight: 400;">审核时间：<fmt:formatDate value="${e.auditDate}" pattern="yyyy-MM-dd HH:mm:ss"/></span>
										<!-- <span class="label label-danger" style="margin-left: 5px;font-size: 90%;font-weight: 400;">未通过审核</span> -->
										<span class="label label-danger" title="不通过原因" style="margin-left: 5px;font-size: 90%;font-weight: 400;cursor:pointer" data-container="body" data-toggle="popover" data-placement="top" data-content="${e.auditContent}">未通过审核</span>	
									</c:if>
								</div>
							</div>
						</div>
					</div>
				</c:forEach>			
				<div class="form-actions" style="background-color: #fff;padding-left: 70px;">
					<%-- <shiro:hasPermission name="zx:audit:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission> --%>
					<a href="${ctx}/zx/makeTender/audit"><input class="btn" type="button" value="返 回" style="background-color: #e7e7e7;"/></a>
				</div>
			</div>
		</form:form>
	  </div>
	</div>
</body>
</html>